<?php require_once('../../core/import.php');?>
<?php User::Permission('NEWS_ADD'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript" src="../../scripts/components/kindeditor/import.kindeditor.js"></script>
    <script type="text/javascript" src="scripts/add.js"></script>
	<script type="text/jscript" src="scripts/oc_upload.js"></script>

<!--二级联动开始-->
    <script language="JavaScript"> 
<?php
	$Data=DB::GetRows('select Identifying,Name,Identifying_Parent from `news_class` where Identifying_Parent is not null');
	$Data_Len=count($Data);
	$j=0
?>

	var num;
	var calArray=new Array();
<?php
	 for($i=0;$i<$Data_Len;$i++){
		 $Row_Class=$Data[$i]
?>
	calArray[<?php echo $i;?>]=new Array("<?php echo $Row_Class["Identifying"];?>","<?php echo $Row_Class["Name"];?>","<?php echo $Row_Class["Identifying_Parent"];?>");
<?php
$j=$j+1;
	 }
?>
	num=<?php echo $j;?>;
	function givevalue(myvalue){
	document.Form1.SecondClass.length = 0;
	    for (i=0;i < num; i++)
		  {
			if (calArray[i][2] == myvalue)
			{
			 document.Form1.SecondClass.options[document.Form1.SecondClass.length] = new Option(calArray[i][1], calArray[i][0],"","");
			     
			     }       
		   }
	}
	</script>
<!--二级联动结束-->
</head>

<body>
    <form id="Form1" name="Form1" method="post" enctype="multipart/form-data" action="add.action.php" class="Form">
        <fieldset>
            <legend>基本信息</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
                <td width="130" height="25" align="left">标题：</td>
                <td width="910" colspan="2">
                    <input type="text" id="Title" name="Title"  size="100" class="Textbox" onBlur="callServer();" /><font color="red">*</font> <span id="title_aj" >&nbsp;</span>
                </td>
            </tr>
             <tr>
             	<td height="25" align="left" valign="middle">缩略图：</td>
            	<td colspan="2"><input type="File" id="Thumbnail" name="Thumbnail" class="Textbox" /></td>
            </tr>
             <tr>
                <td width="130" height="25" align="left">来源：</td>
                <td width="910" colspan="2">
                    <input type="text" id="Origin" name="Origin" size="40" class="Textbox" />
                </td>
            </tr>
             <tr>
                <td width="130" height="25" align="left">关键词：</td>
                <td width="910" colspan="2">
                    <input type="text" id="Keywords" name="Keywords" size="40" class="Textbox" /><font color="red" size="-1">（说明：标签间用全角"；"分开，最后一个标签不加"；"）</font>
                </td>
            </tr>
            <tr>
                <td width="130" height="25" align="left">核心提示：</td>
                <td width="910" colspan="2">
               		<textarea id="Summary" name="Summary" style="width:40%; height:100px;"></textarea>
                </td>
            </tr>
            <tr>
            	<td height="25" align="left" valign="top">内容：</td>
            	<td colspan="2"><textarea id="Content" name="Content" style="width:100%; height:500px;"></textarea></td>
            </tr>
             <tr>
                <td width="130" height="25" align="left">作者：</td>
                <td width="910" colspan="2">
                    <input type="text" id="Auhtor" name="Auhtor" size="40" class="Textbox" />
                </td>
            </tr>
            <tr>
                <td width="130" height="25" align="left">相关新闻：</td>
                <td width="910" colspan="2">
                   <script type="text/javascript">ocUpload.init(200);</script>
                </td>
            </tr>
          
               </table>
        </fieldset>

 <fieldset>
            <legend>其它选项</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
                <td width="130" height="25" align="left" valign="middle">类别：</td>
                <td width="910" colspan="2">
                <select name="FirstClass" size="1" id="FirstClass" onChange="givevalue(document.Form1.FirstClass.options[document.Form1.FirstClass.selectedIndex].value)">
	  		<option value="">--请选择一级类别--</option> 
			<?php	
			$data=DB::GetRows('select Identifying,Name from `news_class` where Identifying_Parent is null');
			$data_first=$data[0]['Identifying'];
				  foreach($data as $Row)
				  {
                  ?>
                  <option value="<?php echo $Row['Identifying'];?>"> <?php echo $Row['Name'];?></option>
                  <?php 
                   	  }
                  ?>
                  </select>
                  <select name="SecondClass" size="1" id="SecondClass">
                    	 <option value="">--请选择二级类别--</option>
                  <?php
                   	 foreach(DB::GetRows('select Name,Identifying,Identifying_Parent from `news_class` where Identifying_Parent='.$data_first.'') as $Row)
                 		 {
                  ?>
                          <option value="<?php echo $Row["Identifying"];?>"><?php echo $Row["Name"];?></option>
                  <?php
                		  }
                  ?>
                  </select>
                </td>
            </tr>
            <tr>
            	<td height="25" align="left" valign="middle">置顶：</td>
            	<td colspan="2"> 
                  	<input type="radio" name="M_IsTop" value="1" /> 是&nbsp;
	  			<input type="radio" name="M_IsTop" value="0" checked/> 否 
                  </td>
            </tr>
           <tr>
             	<td height="25" align="left" valign="middle">头条：</td>
            	<td colspan="2"> 
                  	<input type="radio" name="M_IsHeadline" value="1" /> 是&nbsp;
	  			<input type="radio" name="M_IsHeadline" value="0" checked/> 否 
                  </td>
            </tr>
            <tr>
            	<td height="25" align="left" valign="middle">推荐：</td>
            	<td colspan="2"> 
                  	<input type="radio" name="M_IsRecommend" value="1" /> 是&nbsp;
	  			<input type="radio" name="M_IsRecommend" value="0" checked/> 否 
                  </td>
            </tr>
               </table>
        </fieldset>

        <input id="ActionButton" name="ActionButton" type="submit" value="确定" class="button" /> <input id="ResetButton" name="ResetButton" type="reset" value="重置" class="button" />
    </form>
</body>
</html>